feat(explore): graphify code graph as a freshness-gated, lead-not-evidence explore role - #184
Merged
Conversation
…dence explore role Integrates the local graphify CLI into dev-loop as an optional `explore` role for planning: orchestrate Preflight checks graph freshness and offers the AST-only `graphify update` behind a consent chooser; Phase 2 derives affected files and shared surfaces from `graphify explain`/`path` as leads that a search must confirm; wiki-plan A2 accepts a graph citation only paired with search evidence; loop-implement step 1 runs explain/path before opening source and step 6 names graph-derived assumptions. Zero-config behavior is unchanged. - scripts/graph-freshness.sh: 0 fresh / 2 stale <N> / 3 absent / 4 cannot-evaluate <usage|no-cli|bad-graph|not-git>; mtime vs `git log --since -m --first-parent`; never executes graphify (its exit code carries no signal); unborn HEAD and graph-output-dir commits handled - tests: graph-freshness.bats (19), orchestrate-graph-explore.bats (22 doc-gates with negative controls), resolve-tools.bats (+2) - docs: references/tool-profile.md explore subsection, tools.example.json - wiki: infrastructure/agent-orchestration/code-graph-as-orientation-layer (sources: Developers Digest, AQ Score, Autonoma, Tiare Balbi, graphify README; measured on graphifyy 0.4.23) - plans/graphify-explore-role: analysis, design (plan-reviewer PASS), tasks Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018nX2peuAu8mwFdTpDoBNnA
This was referenced Sep 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates the local graphify code-graph CLI into dev-loop as an optional, freshness-gated
explorerole — a lead-not-evidence orientation layer for planning. With graphify absent, behavior is byte-for-byte unchanged (full suite green with graphify offPATH;resolve-toolsexplore default stilldefault).scripts/graph-freshness.sh(new): one stdout token + exit contract —fresh/0,stale <N>/2,absent/3,cannot-evaluate <usage|no-cli|bad-graph|not-git>/4. Freshness =graph.jsonmtime vsgit log --since=@<epoch> -m --first-parent --name-only(graph.json stores no commit sha). It never executes graphify — the CLI exits 0 on a missing node, a missing file, and a JSON decode error (measured on graphifyy 0.4.23), so the graph is validated withjqinstead. Unborn HEAD, commits touching only the graph output dir, and uncommitted edits are handled.staleone chooser offers the AST-onlygraphify update <root>(consent-gated, never a full build); Phase 2 usesgraphify explain/pathas leads to seed affected files and shared surfaces, recorded only paired with a search (graphify explain X -> N connections; grep ... -> n hits); the brief's<tools_guidance>carries the explore row with--graph <main-root>/graphify-out/graph.json(worktrees carry no graphify-out).evidence:token;plan-gate.shuntouched.exploreis graphify;graph-derived: <assumption>on the report's NOTES line; CLI only, the graphify skill document is never loaded.references/tool-profile.mdexplore subsection,examples/tools.example.json, resolve-tools explorewhentext.infrastructure/agent-orchestration/code-graph-as-orientation-layer.md(field-tested; sources: Developers Digest, AQ Score, Autonoma, Tiare Balbi, graphify README, plus measurements below) + index row,INDEX.mdscope text,log.mdentry.plans/graphify-explore-role/— analysis (spikes S1–S5), design (plan-reviewer PASS), 5 tasks.Measurements that shaped the design (linkly-calendar, 1,306-node graph)
graphify query "<planning sentence>"returned unrelated nodes;explain <Class>returned 20 precise connections;path A Ba 3-hop routeexplain/path;queryonly for orientation with--budget 800graphify benchmark→ 11.4x avg token reduction (6.3x–22.2x), not the advertised 27–70x--budgetonexplainis ignored| head -40graphmetadata empty; 97 files changed since the last build → stalegraphify-out/gitignored → worktrees carry none--graphat the main checkoutTest plan
bats tests/graph-freshness.bats— 19 cases (usage ×3, absent, fresh, stale, bad-graph ×2, no-cli, not-git, dirty-worktree, empty nodes,--graphoverride, output-dir-only commit, unborn HEAD, old-branch merge, distinct-path count, single-line stdout, binary never executed); the-m --first-parentand output-dir filters are mutation-provenbats tests/orchestrate-graph-explore.bats— 22 section-scoped doc-gates, each with a negative-control fixturebats tests/resolve-tools.bats— +2 (graphify cli config resolves; no-config default unchanged)PATH: rc 0;node scripts/wiki-structure-checks.js wiki→ findings 0;wiki-lint-prohibitions.js→ violations 0date -r/statfallback chain, bats compatibility)Follow-ups (not in this PR): mention graphify in
skills/configure/SKILL.md's explore examples; per-repographify hook installfor post-commit refresh.🤖 Generated with Claude Code
https://claude.ai/code/session_018nX2peuAu8mwFdTpDoBNnA